package com.example.shardingsphere.config.shard;

import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;

import java.util.Properties;

public class ShardDBBoundaryRangeConfig {

    /**
     * 配置分库算法
     *
     * @return
     */
    public static ShardingSphereAlgorithmConfiguration shardDBAlgorithmsProps() {

        Properties dbShardingAlgorithmrProps = new Properties();
        // sharding-count 分片的数量，数据库的数量
        dbShardingAlgorithmrProps.setProperty("sharding-ranges", "3");

        return new ShardingSphereAlgorithmConfiguration("BOUNDARY_RANGE", dbShardingAlgorithmrProps);
    }
}
